Git & GitHub Cheatsheet

November 28, 2022

Git Config

Configures user information used across all local repositories.

git config --global user. name "username"

git config --global user. email "email"

Git Init

Create an empty Git repository or reinitialize an existing one

git init

Git Clone

Clone a repository into a new directory

git clone [url]

Git Add

Add file contents to the index

git add file-name
git add *
git add .

Git Commit

Record changes to the repository

git commit -m "Commit message"

Git Push

Update remote refs along with associated objects

git push origin master

Git Status

Show the working tree status

git status

Git Remote

Connect to the remote repository

git remote add origin master

Git Branch

List, create, or delete branches

git branch

Git Pull Request

Fetch from and integrate with another repository or a local branch

git pull

Git Merge Request

Join two or more development histories together

git merge

Profile picture

Written by Manthan Ankolekar who lives and works in Karnataka, India. You should follow them on Twitter